<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="box"></div>
    <script>
        var myname = "张三";
        // var str = "<h1>我是标题"+myname+"</h1>\
        // <p>我是内容</p>";
        // 通过反引号 定义字符串 
        var str = `<h1>我是标题${myname}</h1>
        <p>我是内容</p>`  ; // 反引号 数字键 1 的左边 esc下边 ；
        
        document.querySelector(".box").innerHTML = str;


    </script>
</body>
</html>